<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');

$shopList = Shop::GetAllShops();



if ( $_POST ) {
	$staff = array();
	$staff['family_name'] = $_POST['family_name'];
	$staff['personal_name'] = $_POST['personal_name'];
	$staff['sex'] = $_POST['sex'] == 1 ? 1 : 0;
	$staff['tel_no'] = $_POST['tel_no'];
	$staff['addr'] = $_POST['addr'];
	$staff['shop_id'] = $_POST['shop_id'];
	
	Staff::Create($staff);
}else{
	Logs::setLog("select sql||=get");
	if($_GET['id'] == null){
		Logs::setLog("select sql||= get id == null");
		$staffList = Staff::GetAll();
		include template('service_staff_list');
		exit;
	}
	$staff = Staff::getById( abs( intval( $_GET['id'] ) ) );
	

}



include template('/service/service_staff_index');
//include template('subscribe');
